﻿namespace System
{
    public static class Date
    {
        public static readonly DateTime LowDate = new DateTime(1850, 1, 1);
        public static readonly DateTime HighDate = new DateTime(2999, 12, 31, 23, 59, 59, 995);

        public static bool _IsBetween(this DateTime test, DateTime startDate, DateTime endDate)
        {
            return test >= startDate && test <= endDate;
        }

        public static string ToUrlString(this DateTime value)
        {
            return value.ToString("ddMMMyyyy");
        }

        public static string ToDisplayString(this DateTime value)
        {
            return string.Format("{0} {1}", value.Day.AddOrdinal(), value.ToString("MMMM yyyy"));
        }
    }
}
